using System;
using System.Web.Optimization;

namespace onYOURway {
  public class BundleConfig {
    public static void RegisterBundles(BundleCollection bundles) {
      bundles.IgnoreList.Clear();
      AddDefaultIgnorePatterns(bundles.IgnoreList);

      bundles.Add(
        new ScriptBundle("~/scripts/vendor")
          .Include("~/Scripts/jquery-{version}.js")
          .Include("~/Scripts/knockout-{version}.debug.js")
          .Include("~/Scripts/sammy-{version}.js")
          .Include("~/Scripts/toastr.js")
          .Include("~/Scripts/Q.js")
          .Include("~/Scripts/breeze.debug.js")

          .Include("~/Scripts/moment.js")   // better javascript support for Date
          .Include("~/Scripts/javascript.util.js")  // helper for java-ports like jsts
          .Include("~/Scripts/jsts.js")   // JavaScript Topology Suite (js-Port of JTS - geography library)

          .Include("~/Scripts/leaflet-{version}.js")  // map-control
          .Include("~/Scripts/leaflet.awesome-markers.js")  // easy markers
          .Include("~/Scripts/leaflet.overpass-layer.js")  // dirctly display results (nodes only) of overpass-osm queries
          .Include("~/Scripts/leaflet.markercluster-src.js")  // cluster nearby markers

          .Include("~/Scripts/bootstrap.js")
          //.Include("~/Content/themes/metro-bootstrap/bootstrap-datetimepicker.min.js")

        );

      bundles.Add(
        new StyleBundle("~/Content/css")
          .Include("~/Content/ie10mobile.css")

        //.Include("~/Content/bootstrap-responsive.css")
        //.Include("~/Content/durandal.css")

          .Include("~/Content/toastr.css")

          .Include("~/Content/styles/leaflet-{version}.css")
          .Include("~/Content/styles/font-awesome.min.css")
          .Include("~/Content/styles/leaflet.awesome-markers.css")

          .Include("~/Content/styles/MarkerCluster.css")
	        .Include("~/Content/styles/MarkerCluster.Default.css")

          .Include("~/Content/styles/bootstrap.css")
          //.Include("~/Content/themes/metro-bootstrap/metro-bootstrap.css")
          //.Include("~/Content/themes/metro-bootstrap/bootstrap-datetimepicker.min.css")

          .Include("~/Content/styles/media.css")
          .Include("~/Content/app.css")
          .Include("~/Content/onYOURway.css")
        );
    }

    public static void AddDefaultIgnorePatterns(IgnoreList ignoreList) {
      if (ignoreList == null) {
        throw new ArgumentNullException("ignoreList");
      }

      ignoreList.Ignore("*.intellisense.js");
      ignoreList.Ignore("*-vsdoc.js");

      //ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
      //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
      //ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
    }
  }
}